#ifndef __Ucos_H
#define __Ucos_H

#ifdef __cplusplus 
extern "C"
{
#endif


#define  config_max_tasks  8     
#define  configTICK_RATE_us 1000   
#define  WHILE(a)
#define  OSTimeDly(k) {ucos_task[OSTCBCur].one.rdy =0; ucos_task[OSTCBCur].delay =k-1; }



	
void   OsInit(void);
void   OSTimeTick(void);
int    OSTaskCreate(void (*task)(void* p_arg));
void   OSTimeDlyMS(unsigned short ms);


	typedef struct
	{
		struct struct_tcb
		{
			unsigned rdy : 1;     
			unsigned enable : 1; 
		}one;
		unsigned short delay;  
		unsigned char step; 
		void  (*task)();
	}OSTCB_TypeDef;


	extern unsigned char OSTCBCur;
	extern OSTCB_TypeDef ucos_task[config_max_tasks];


#ifdef __cplusplus 
}
#endif



#endif

